<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>12-案例土豆网鼠标经过显示遮罩</title>
    <style>
        .tudou {
            position: relative;
            width: 444px;
            height: 320px;
            background-color: aqua;
            margin: 30px auto;
        }
        .tudou img {
            height: 100%;
            width: 100%;
        }
        .mask {
            /* 隐藏遮罩层 */
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, .4) url(img/arr.jpeg) no-repeat center ;
        }
        /* 鼠标经过，显示“里面的”遮罩层 */
        .tudou:hover .mask {
            /* 不是转换块级元素，而是显示的意思 */
            display: block;
        }
    </style>
</head>
<body>
    <div class="tudou">
        <div class="mask"></div>
        <img src="img/tudou.jpeg" alt="">
    </div>
    <img src="img/12-案例.png" alt="">
</body>
</html>